package org.jeecg.modules.system.mapper;

import java.util.List;
import java.util.SplittableRandom;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.AppButton;
import org.jeecg.modules.system.model.AppButtonTreeModel;

/**
 * @Description: 移动端按钮控制
 * @Author: jeecg-boot
 * @Date:   2019-11-26
 * @Version: V1.0
 */
public interface AppButtonMapper extends BaseMapper<AppButton> {
    @Select("select * from app_button where parent_id = #{parentId} AND del_flag = '0' order by sort asc")
    List<AppButton> queryButtonList(@Param("parentId") String parentId);
    @Select("SELECT id, parent_id, button_name,picture,type AS type from   app_button WHERE(type = 'menu'OR type = 'button')AND del_flag = '0'")
    List<AppButton> queryAppButtonList();
    @Select("select * from app_button where parent_id =#{id} and del_flag='0'")
     List<AppButton> queryById(@Param("id") String id);
    @Select("select receive_position_code from prj_repair_config where depart_id =#{officeId} AND del_flag='0'")
    String  selectRepairConfig(@Param("officeId") String officeId);
    @Select("select count(0) from prj_repair where #{status}='100' and del_flag='0'")
    Integer selectAcpectRepairCount();
    @Select("select count(0) from prj_repair_status where  status ='100' and user_id=#{userId}")
    Integer selectRepairTaskCount(@Param("userId") String userId);
    @Select("select position_id from complaint_config where depart_id =#{parentId} and del_flag='0'")
    String selectComplainConfig(@Param("parentId") String parentId);
    @Select("select count(0) from complain where status='100' and del_flag='0'")
    Integer selectComplainCount();
    @Select("select count(0) from process_inspection where status = '100' and user_id =#{userId} AND del_flag='0'")
    Integer selectInspectionCount(@Param("userId") String userId);
}
